export default {
	data() {
		return {
			mp: {
				statusBarHeight: 0, // 小程序状态栏高度
				navBarHeight: 0, // 小程序导航栏高度
				topBarHeight: 0, // 小程序顶部状态栏+导航栏高度
				menuButtonHeight: 0, // 小程序胶囊高度
				menuTop: 0, // 小程序胶囊top位置
				navBarSafeArea: {
					// 小程序导航条安全区域（胶囊）
					left: 0,
					right: 0,
				},
				poster: {
					css: {
						width: "652rpx",
						height: "1039rpx",
						padding: "64rpx 38rpx 16rpx 38rpx",
						borderRadius: "40rpx",
						backgroundImage: ""
					},
					views: [{
							src: "",
							type: "image",
							css: {
								objectFit: "cover",
								objectPosition: "50% 50%",
								borderRadius: "40rpx",
								marginBottom: "46rpx",
								width: "576rpx",
								height: "576rpx"
							},
						}, {
							css: {
								marginBottom: "24rpx",
							},
							views: [{
								src: "",
								type: "image",
								css: {
									objectFit: "cover",
									objectPosition: "50% 50%",
									borderRadius: "50%",
									marginRight: "10rpx",
									width: "60rpx",
									height: "60rpx"
								},
							}, {
								text: "",
								type: "text",
								css: {
									verticalAlign: "middle",
									fontWeight: '900',
									fontSize: '30rpx',
									color: "#282D2D",
								},
							}, {
								text: "｜",
								type: "text",
								css: {
									verticalAlign: "middle",
									fontSize: "24rpx",
									color: "#999B9B",
								},
							}, {
								text: "杭州",
								type: "text",
								css: {
									verticalAlign: "middle",
									fontSize: "24rpx",
									color: "#999B9B",
								},
							}],
							type: "view"
						}, {
							css: {
								fontSize: "26rpx",
								color: "#282D2D",
								lineHeight: "37rpx",
							},
							views: [{
								text: "",
								type: "text",
								css: {
									lineClamp: 2,
								},
							}],
							type: "view"
						}, {
							css: {
								position: "absolute",
								bottom: '52rpx',
								right: "65rpx"

							},
							views: [{
								src: "",
								type: "image",
								css: {
									objectFit: "cover",
									objectPosition: "50% 50%",
									borderRadius: "50%",
									width: "84rpx",
									height: "84rpx"
								},
							}],
							type: "view"
						},
						{
							css: {
								position: "absolute",
								bottom: '16rpx',
								right: "47rpx"
							},
							views: [{
								text: "长按扫码查看",
								type: "text",
								css: {
									// verticalAlign: "middle",
									fontWeight: '400',
									fontSize: '20rpx',
									color: "#999B9B",
								},
							}],
							type: "view"
						}
					]
				}
			},
		};
	},
	computed: {
		isMp() {
			// #ifdef MP
			return true;
			// #endif
			return false;
		},
	},
	created() {
		// #ifdef MP
		// 获取状态栏高度
		const {
			screenWidth,
			statusBarHeight
		} = uni.getSystemInfoSync();
		this.mp.statusBarHeight = statusBarHeight;
		const {
			width,
			height,
			top,
			right
		} = uni.getMenuButtonBoundingClientRect(); // 胶囊的坐标
		// 计算导航栏的高度，此高度基于右上角菜单在导航栏位置垂直居中计算得到
		this.mp.menuTop = top
		this.mp.menuButtonHeight = height;
		this.mp.navBarHeight = height + (top - statusBarHeight) * 2;
		this.mp.topBarHeight = this.mp.statusBarHeight + this.mp.navBarHeight;
		this.mp.navBarSafeArea.right = (screenWidth - right) * 2 + width;
		// #endif
	},
};